{layout name="layout" /}
<!-- Main content -->
<div class="box box-default">
    <div class="box-header with-border">
        {if condition="isset($data['user_id'])"}
        <h3 class="box-title">修改用户信息</h3> {else /}
        <h3 class="box-title">新增用户</h3> {/if}
    </div>
    <div class="row">
        <div class="col-xs-12">
            <form class="form-horizontal ingeAjax" method="post" action="{if condition=" isset($data.user_id) "}{:url('home/User/edit_member','uid='.$data['user_id'])}{else /}{:url('home/User/edit_member')}{/if}">
                <div class="space-2"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 用户名： </label>
                    <div class="col-sm-10">
                        <input type="text" class="form-group-new  col-xs-12 col-sm-4" placeholder="用户名" required/ name="user_name" value="{$data.user_name|default=''}">
                        <span class="lbl col-xs-12 col-sm-4">&nbsp;&nbsp;<span class="red">*</span>必填，用户名长度5-25</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 昵称： </label>
                    <div class="col-sm-10">
                        <input type="text" class="form-group-new  col-xs-12 col-sm-4" placeholder="昵称" name="user_nicename" value="{$data.user_nicename|default=''}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 密码： </label>
                    <div class="col-sm-10">
                        <input type="text" class="form-group-new  col-xs-12 col-sm-4"  {if condition=" isset($data) !='' "}placeholder="请输入密码,不修改留空"{else /}placeholder="请输入密码" required/ {/if}  name="user_pwd" value="">
                        <span class="lbl col-xs-12 col-sm-4">&nbsp;&nbsp;<span class="red">*</span>必填，密码长度6-25</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 金币： </label>
                    <div class="col-sm-10">
                        <input type="text" class="form-group-new  col-xs-12 col-sm-4" name="coin" placeholder="0.00" value="{$data.coin|default=''}" data-type="number" data-decimal="2" data-name="">
                        <span class="lbl col-xs-12 col-sm-4">&nbsp;&nbsp;<span class="blue">*</span>最多二位小数点</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 积分： </label>
                    <div class="col-sm-10">
                        <input type="text" class="form-group-new  col-xs-12 col-sm-4" placeholder="0" value="{$data.score|default=''}" name="score" data-type="number" data-decimal="0" data-name="">
                        <span class="lbl col-xs-12 col-sm-4">&nbsp;&nbsp;<span class="blue">*</span>整数</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 性别： </label>
                    <div class="col-sm-10">
                        {if condition="isset($data)"}
                            {switch name="$data['sex']"}
                            {case value="0"}<input type="radio" class="flat-blue" name="sex" checked value="0">保密
                            <input type="radio" class="flat-blue" name="sex" value="1">男
                            <input type="radio" class="flat-blue" name="sex" value="2">女{/case}
                            {case value="1"}<input type="radio" class="flat-blue" name="sex"  value="0">保密
                            <input type="radio" class="flat-blue" name="sex" checked value="1">男
                            <input type="radio" class="flat-blue" name="sex" value="2">女{/case}
                            {case value="2"}<input type="radio" class="flat-blue" name="sex"  value="0">保密
                            <input type="radio" class="flat-blue" name="sex" value="1">男
                            <input type="radio" class="flat-blue" name="sex" checked value="2">女{/case}
                        {/switch}
                        {else /}
                            <input type="radio" class="flat-blue" name="sex" checked value="0">保密
                            <input type="radio" class="flat-blue" name="sex" value="1">男
                            <input type="radio" class="flat-blue" name="sex" value="2">女
                        {/if}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 邮箱： </label>
                    <div class="col-sm-10">
                        <input type="email" class="form-group-new  col-xs-12 col-sm-4" placeholder="请输入邮箱" name="email" value="{$data.email|default=''}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 手机号： </label>
                    <div class="col-sm-10">
                        <input type="mobile" class="form-group-new  col-xs-12 col-sm-4" placeholder="请输入手机号" name="mobile" value="{$data.mobile|default=''}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 个人网站： </label>
                    <div class="col-sm-10">
                        <input type="text" class="form-group-new  col-xs-12 col-sm-4" placeholder="http://www.ingecmf.com" name="user_url" value="{$data.user_url|default=''}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 个人签名： </label>
                    <div class="col-sm-10">
                        <textarea class="form-group-new col-xs-12 col-sm-4" name="signature" placeholder="">{$data.signature|default=''}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 是否启用： </label>
                    <div class="col-sm-10">
                        {if condition="isset($data)"} {if condition="$data.status eq 1"}
                        <input type="checkbox" name="status" class="flat-blue" checked>{else /}
                        <input type="checkbox" name="status" class="flat-blue">{/if} {else / }
                        <input type="checkbox" name="status" class="flat-blue" checked> {/if}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 邮箱是否验证： </label>
                    <div class="col-sm-10">
                        {if condition="isset($data)"} {if condition="$data.email_confirmed eq 1"}
                        <input type="checkbox" name="email_confirmed" class="flat-blue" checked>{else /}
                        <input type="checkbox" name="email_confirmed" class="flat-blue">{/if} {else / }
                        <input type="checkbox" name="email_confirmed" class="flat-blue"> {/if}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 手机号是否验证： </label>
                    <div class="col-sm-10">
                        {if condition="isset($data)"} {if condition="$data.mobile_confirmed eq 1"}
                        <input type="checkbox" name="mobile_confirmed" class="flat-blue" checked>{else /}
                        <input type="checkbox" name="mobile_confirmed" class="flat-blue">{/if} {else / }
                        <input type="checkbox" name="mobile_confirmed" class="flat-blue"> {/if}
                    </div>
                </div>
                <div class="form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button class="btn btn-primary" type="submit">
                            <i class="fa fa-check bigger-110"></i> 保存
                        </button> &nbsp; &nbsp; &nbsp; {if condition="isset($data.user_id)"}
                        <button class="btn" type="reset" onclick="history.go(-1);">
                            <i class="fa fa-undo bigger-110"></i> 返回
                        </button>
                        {else /}
                        <button class="btn" type="reset">
                            <i class="fa fa-undo bigger-110"></i> 重置
                        </button>
                        {/if}
                    </div>
                </div>
                <div class="space"></div>
            </form>
        </div>
    </div>
</div>
<!-- /.row -->
</section>
{include file="public/base" /} {include file="public/edit" /} {include file="public/footer" /}
<!-- bootstrap datepicker -->
<link rel="stylesheet" href="/static/plugins/datepicker/datepicker3.css">
<!-- bootstrap datepicker -->
<script src="/static/plugins/datepicker/bootstrap-datepicker.js"></script>
<script>
$(function() {
    $(".select2").select2();
    $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
        checkboxClass: 'icheckbox_flat-green',
        radioClass: 'iradio_flat-green'
    });
    $('#datepicker2,#datepicker1').datepicker({
        autoclose: false,
        beforeShowDay: $.noop,
        calendarWeeks: false,
        clearBtn: false,
        daysOfWeekDisabled: [],
        endDate: Infinity,
        forceParse: true,
        format: 'yyyy-mm-dd',
        keyboardNavigation: true,
        language: 'cn',
        minViewMode: 0,
        orientation: "auto",
        rtl: false,
        startDate: -Infinity,
        startView: 0,
        todayBtn: false,
        todayHighlight: false,
        weekStart: 0
    });
});
</script>
</body>

</html>
